# Contributor: Fabricio Silva <hi@fabricio.dev>
# Maintainer: Fabricio Silva <hi@fabricio.dev>
pkgname=xcaddy
pkgver=0.3.5
pkgrel=2
pkgdesc="Build Caddy with plugins"
url="https://github.com/caddyserver/xcaddy"
license="Apache-2.0"
arch="all"
depends="go"
source="https://github.com/caddyserver/xcaddy/archive/v$pkgver/caddy-$pkgver.tar.gz"
options="net" # for downloading Go modules

export CGO_ENABLED=0
export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -trimpath -o bin/xcaddy ./cmd/xcaddy
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/xcaddy -t "$pkgdir"/usr/sbin/
}

sha512sums="
7f37bf819618d51dcc4dfd89a90403c0841f277bcf5f9f3cf548ed89d486faf92608522df161ad3a2daf9f046feb91c4b4feb6f7ddeb336c9e0946576052b34e  caddy-0.3.5.tar.gz
"
